package com.ruoyi.business.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.business.mapper.BusinessOrderMapper;
import com.ruoyi.business.domain.BusinessOrder;
import com.ruoyi.business.service.IBusinessOrderService;
import com.ruoyi.common.core.text.Convert;

/**
 * 业务订单Service业务层处理
 * 
 * @author leach
 * @date 2020-06-24
 */
@Service
public class BusinessOrderServiceImpl implements IBusinessOrderService 
{
    @Autowired
    private BusinessOrderMapper businessOrderMapper;

    /**
     * 查询业务订单
     * 
     * @param id 业务订单ID
     * @return 业务订单
     */
    @Override
    public BusinessOrder selectBusinessOrderById(Long id)
    {
        return businessOrderMapper.selectBusinessOrderById(id);
    }

    /**
     * 查询业务订单列表
     * 
     * @param businessOrder 业务订单
     * @return 业务订单
     */
    @Override
    public List<BusinessOrder> selectBusinessOrderList(BusinessOrder businessOrder)
    {
        return businessOrderMapper.selectBusinessOrderList(businessOrder);
    }

    /**
     * 新增业务订单
     * 
     * @param businessOrder 业务订单
     * @return 结果
     */
    @Override
    public int insertBusinessOrder(BusinessOrder businessOrder)
    {
        businessOrder.setCreateTime(DateUtils.getNowDate());
        return businessOrderMapper.insertBusinessOrder(businessOrder);
    }

    /**
     * 修改业务订单
     * 
     * @param businessOrder 业务订单
     * @return 结果
     */
    @Override
    public int updateBusinessOrder(BusinessOrder businessOrder)
    {
        return businessOrderMapper.updateBusinessOrder(businessOrder);
    }

    /**
     * 删除业务订单对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteBusinessOrderByIds(String ids)
    {
        return businessOrderMapper.deleteBusinessOrderByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除业务订单信息
     * 
     * @param id 业务订单ID
     * @return 结果
     */
    @Override
    public int deleteBusinessOrderById(Long id)
    {
        return businessOrderMapper.deleteBusinessOrderById(id);
    }
}
